<script type="text/javascript">
menuLayers.show = function(id, controller, objid, objname, e) {
    var mnu = document.getElementById? document.getElementById(id): null;
    if (!mnu) return;
    this.activeMenuID = id;
    if ( mnu.onmouseout == null ) mnu.onmouseout = this.mouseoutCheck;
    if ( mnu.onmouseover == null ) mnu.onmouseover = this.clearTimer;
    viewport.getAll();
    rewritePopupContent(controller, objid, objname);

    this.position(mnu,e);
}
</script>

<script>
function confirmAndDelete(url) {
	if (confirm("Adakah Anda Pasti?")) {
		location = url
	}
	
}


function rewritePopupContent(controller, objid, objname) {
    $('popmenu').style.width = 180;
    $('popmenu').innerHTML = "<ul>" + 
					       "<li><a href=\""  + "?act=view_ahli&" + "id=" + objid + "\">&nbsp;&nbsp;Papar Maklumat Ahli</a>" + 

					       "<li><a href=\""  + "?act=edit_ahli&" + "id=" + objid + "\">&nbsp;&nbsp;Edit Maklumat Ahli</a>" + 

<?
if ($_SESSION['ACCESS_LEVEL'] != '5') {
?>
					       "<li><a href=\"javascript: confirmAndDelete('?act=delete_ahli&id=" + objid + "')" + "\">&nbsp;&nbsp;Hapus Rekod Ahli</a>" + 
<? } ?>
					       "<hr size=1><li><a href=\""  + "?act=edit_penyata&" + "id=" + objid + "\">&nbsp;&nbsp;Pembayaran</a>" + 
					       "</ul>"
     
}

function a(id) {
	MM_openBrWindow('/course_implementations/show_timetable2/'+id,'','scrollbars=yes,width=1000,height=600')
}
</script>

<script>
function getAjaxDaerah() {
	//$('item_selection').innerHTML = "<font color=orange>Searching Items...please wait</font>"
	ajax_department_request("ajax.php?act=daerahs_of_negeri", "negeri_id="+$("select_negeri").value)
}

function ajax_department_request(url, data) {
    var myAjax = new Ajax.Request(
        url,
        {method: 'post', parameters: data, onComplete: ajax_department_response}
    );
}

function ajax_department_response(originalRequest) {
	if (originalRequest.responseText != 0) {
		var a = originalRequest.responseText.split("$$")
		var k = new Array(a.length)
		for (i=0; i<k.length; i++) {
			k[i] = a[i].split("=")
		}
		//alert(originalRequest.responseText)
		
		str  = "<select  id=\"select_ppd\" name=\"d\" class=\"px200\" onchange=\"//getAjaxSubItem()\">\n";
		str += "<option value=\"\">--Semua Daerah--</option>\n"
		for (i=0; i<k.length; i++) {
			str += "<option value=\"" + k[i][1] + "\">" + k[i][0] + "</option>\n";
		}
		str += "</select>\n";
		$("select_ppd_span").innerHTML = str;
	}
	else {
		$('select_ppd_span').innerHTML = "<font color=orange>List not found</font>"
	}
}
</script>

        
        <div id="content">
            <div id="content_header" class="size_20" style=" border-bottom-width:medium; border-bottom-style:solid; border-bottom-color:#777777">
            	<img src="images/icn_mytaskTitle.gif" align="absmiddle" width="" height="">Pembayaran Individu </div>
        	<div id="content_bgblue">
                <div id="content_bgwhite">
        
<div id="kandungan" style="border: 0pt solid silver; width: 100%;">

            <? alert_some_message()?>


<form name="search" action="?act=search_ahli" method="POST" target="" onSubmit="" onReset="">
<fieldset style="background:#ffffff; border-width:thin; border-style:solid; padding:10px; border-color:#CCCCCC;">
<legend style="font-size:1.0em; font-weight: bold;">Carian </legend>

<script>
function toggleClear(val) {
	var arr = new Array('q','n','b','l','tm','tb','stop');
	for (i=0;i<arr.length;i++) {
		if (val != arr[i]) {
			document.getElementById(arr[i]).value = '';
		} 
	}
}
</script>
<table border="0" cellpadding="4" cellspacing="1" width="100%">
  <tbody>
    <tr id="SkimRow" style="display: ;">
      <td class="TableField">&nbsp;</td>
      <td width="100" align="right" class="TableField" style="width:200px;"><span class="TableRowLeft">No. Ahli </span></td>
      <td width="10" class="TableField">:</td>
      <td class="TableRowLeft"><input name="n" type="text" id="n"  style="width: 100px;" value="<?=$_REQUEST['n']?>" maxlength="10" onfocus="toggleClear('n');"/></td>
      <td align="right" nowrap="nowrap" class="TableRowLeft"><span class="TableField">Nama Ahli </span> :        </td>
      <td class="TableRowLeft"><input name="q2" type="text" id="q2" style="width: 336px;" value="<?=$_REQUEST['q']?>" maxlength="100" onfocus="toggleClear('q');"/></td>
    </tr>
    <tr id="SkimRow" style="display: ;">
      <td class="TableField">&nbsp;</td>
      <td width="100" align="right" class="TableField" style="width:200px;"><span class="TableRowLeft">No. KP Baru</span></td>
      <td width="10" class="TableField">:</td>
      <td class="TableRowLeft"><input name="b2" type="text" id="b2"  style="width: 100px;" value="<?=$_REQUEST['b']?>" maxlength="10" onfocus="toggleClear('b');" /></td>
      <td align="right" nowrap="nowrap" class="TableRowLeft"><span class="TableField">No. KP Lama : 
        
      </span></td>
      <td width="243" class="TableRowLeft"><span class="TableField">
        <input name="l2" type="text" id="l2"  style="width: 100px;" value="<?=$_REQUEST['l']?>" maxlength="10" onfocus="toggleClear('l');" />
      </span></td>
      </tr>
    
    
    <tr id="NegeriRow" style="">
      <td class="TableField" width="8">&nbsp;</td>
      <td width="100" align="right" class="TableField">Tahun</td>
      <td class="TableField" width="10">:</td>
      <td colspan="3" class="TableRowLeft"><select name="sesi_tahun" id="sesi_tahun" onchange="if (confirm('Are you sure?')) location='?act=edit_penyata&amp;id=<?=$ahli->id?>&amp;sesi_tahun='+this.value;">
        <?
				$combo   = new GUI();
				//$options = getOptionsFromTable('ref_negeri','id','negeri');
				for ($i=2009;$i<=$current_year;$i++) {
					$arr[$i] = $i;
				}
				$options = $arr;
				echo $combo->printCombo2($options, "",false, $selected_year, false,0);
			  ?>
      </select>
        <!--input name="prasekolah" type="checkbox" value="t" checked="checked" />
      Prasekolah -->      </td>
      </tr>
    <tr id="NegeriRow" style="">
      <td class="TableField" width="8">&nbsp;</td>
      <td width="100" align="right" class="TableField">Bulan</td>
      <td class="TableField" width="10">:</td>
      <td width="243" colspan="3" class="TableRowLeft"><select name="select3" id="select" onchange="if (confirm('Are you sure?')) location='?act=edit_penyata&amp;id=<?=$ahli->id?>&amp;sesi_tahun='+this.value;">
        <?
				$combo   = new GUI();
				//$options = getOptionsFromTable('ref_negeri','id','negeri');
				for ($i=2009;$i<=$current_year;$i++) {
					$arr[$i] = $i;
				}
				$options = $arr;
				echo $combo->printCombo2($options, "",false, $selected_year, false,0);
			  ?>
      </select>
        <!--input name="prasekolah" type="checkbox" value="t" checked="checked" />
      Prasekolah -->      </td>
      </tr>
    <tr class="NormalTextLeft">
      <td colspan="6" align="center"><span class="TableRowLeft">
        <input name="button" type="submit" onclick="" value="Cari" style=" width:100px;" />
        <input name="button2" type="reset" onclick="" value="Reset" style=" width:100px;" />
      </span></td>
    </tr>
  </tbody>
</table>
</fieldset>

<br>
</form>

<? if ($res_count > 0) {?>

<table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr>
                <td align="left" scope="col" style=" font-weight:bold; border-bottom-style:solid; border-bottom-width:thin;">Hasil Carian  : <?=$total_count?> Ahli</td>
              </tr>
        </table>
			
		<font class="NormalTextLeft"></font> <br>
<br>
<div style=" overflow: ;">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td align="right">&nbsp;
        <!--a href="export.php?act=search_sek&amp;params=<?php echo $s_params?>"><img src="images/excel.gif"/></a--></td>
    <td width="40" align="left"><? if ($_REQUEST['p'] > 1) {?>
        <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=1"><img height="9px" src="images/rr.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&laquo;&laquo;</b-->
          </a>&nbsp;&nbsp; <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$page-1?>"><img height="9px" src="images/r.png" alt="rr"/>
            <!--b style=" font-size:1.5em">&laquo;</b-->
            </a>
        <? } ?></td>
    <td width="60" align="right"><select name="select2" size="0" onblur="" onchange="location='?act=search_ahli&amp;<?=$paginate_str?>&amp;p='+this.value" onfocus="">
      <?
for ($face=($page-5);$face<($page+5);$face++) {
	if ($face > $last_page) break;
	if ($face < 1) continue;
	$selected = '';
	if ($face == $page) {
		$selected = "selected";
	}
	else {
		$selected = "";
	}
?>
      <option value="<?=$face?>" <?=$selected?>>Muka
        <?=$face?>
      </option>
      <? } ?>
    </select></td>
    <td width="40" align="right"><? if ($_REQUEST['p'] < $last_page) {?>
        <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$page+1?>"><img height="9px" src="images/f.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&raquo;</b-->
          </a>&nbsp;&nbsp; <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$last_page?>"><img height="9px" src="images/ff.png" alt="rr"/>
            <!--b style=" font-size:1.5em">&raquo;&raquo;</b-->
            </a>
        <? } ?></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="2" style=" border:thin; border-color:#CCCCCC; border-style:solid;">
    <tr>
      <td width="20" align="center" bgcolor="#999999" scope="col"><span class="style3">Bil</span></td>
      <td align="center" bgcolor="#999999" scope="col" nowrap><a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;idx=1&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>">No Ahli
          <?=$show_img[1]?>
      </a></td>
      <td align="center" bgcolor="#999999" scope="col"><a href="?act=search_ahli&<?=$paginate_str?>&idx=2&sort_asc=<?=$_SESSION['sort_asc']?>&p=<?=$page?>">Nama Ahli
          <?=$show_img[2]?>
      </a></td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3">No KP Baru</span></td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3">No KP Lama </span></td>
      <td align="center" bgcolor="#999999" scope="col"><a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;idx=3&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>">Cawangan      </a><a href="?act=search_murid&amp;<?=$paginate_str?>&amp;idx=1&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>">
        <?=$show_img[3]?>
      </a></td>
      <td align="center" bgcolor="#999999" scope="col"><span class="style3"><a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;idx=4&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>">Keahlian</a><a href="?act=search_murid&amp;<?=$paginate_str?>&amp;idx=4&amp;sort_asc=<?=$_SESSION['sort_asc']?>&amp;p=<?=$page?>">
        <?=$show_img[4]?>
      </a></span></td>
      <td width="30" align="center" bgcolor="#999999" scope="col">&nbsp;</td>
    </tr>
    <?
$even = true; 
$i = ($page-1)*20;
$i=0;
while ($dat = $res->FetchNextObject()) {
	$dat = decapitalize($dat);
	$i++;
	$even = !$even;
	$bgcolor = ($even)? "":"#E9F0F5";
?>
    <tr bgcolor="<?=$bgcolor?>" onmouseover="this.style.background='#FFFFCC'" onmouseout="this.style.background='<?=$bgcolor?>'" onmousedown="menuLayers.show('popmenu','index.php?act=', '<?=$dat->id?>', 'KPPT(PENDAKWAAN)', event)">
      <td><?=$i?>
        .</td>
      <td><?=strtoupper($dat->no_ahli)?></td>
      <td><?=$dat->nama_ahli?></td>
      <td><?=$dat->nokp_baru?></td>
      <td align="center" style=" width:80px; overflow:scroll; height:20px;"><?=$dat->nokp_lama?></td>
      <td align=""><span style=" width:150px; overflow:scroll; height:20px;">
        <?=$dat->cawangan?>
      </span></td>
      <td><span style=" width:150px; overflow:scroll; height:20px;">
        <?=$dat->keahlian?>
      </span></td>
      <td align="center">&nbsp;</td>
    </tr>
    <? } ?>
  </table>
  <table width="100%" border="0" cellspacing="1" cellpadding="2">
    <tr>
      <td align="right">&nbsp;
          <!--a href="export.php?act=search_sek&amp;params=<?php echo $s_params?>"><img src="images/excel.gif"/></a--></td>
      <td width="40" align="left"><? if ($_REQUEST['p'] > 1) {?>
          <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=1"><img height="9px" src="images/rr.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&laquo;&laquo;</b-->
          </a>&nbsp;&nbsp; <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$page-1?>"><img height="9px" src="images/r.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&laquo;</b-->
          </a>
          <? } ?></td>
      <td width="60" align="right"><select name="select" size="0" onblur="" onchange="location='?act=search_ahli&amp;<?=$paginate_str?>&amp;p='+this.value" onfocus="">
          <?
for ($face=($page-5);$face<($page+5);$face++) {
	if ($face > $last_page) break;
	if ($face < 1) continue;
	$selected = '';
	if ($face == $page) {
		$selected = "selected";
	}
	else {
		$selected = "";
	}
?>
          <option value="<?=$face?>" <?=$selected?>>Muka
            <?=$face?>
          </option>
          <? } ?>
      </select></td>
      <td width="40" align="right"><? if ($_REQUEST['p'] < $last_page) {?>
          <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$page+1?>"><img height="9px" src="images/f.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&raquo;</b-->
          </a>&nbsp;&nbsp; <a href="?act=search_ahli&amp;<?=$paginate_str?>&amp;p=<?=$last_page?>"><img height="9px" src="images/ff.png" alt="rr"/>
          <!--b style=" font-size:1.5em">&raquo;&raquo;</b-->
          </a>
          <? } ?></td>
    </tr>
  </table>
</div>

<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td>&nbsp;</td>
    <td width="20" align="left"><a href="?act=list_sek&p=<?=$_REQUEST['p']-1?>"></a></td>
    <td align="right" width="100">&nbsp;</td>
    <td width="20" align="right"><a href="?act=list_sek&p=<?=$_REQUEST['p']+1?>"></a></td>
  </tr>
</table>
<!--/fieldset-->
<? }
else {
	if (isset($res_count)) {
		echo "Tiada hasil carian.";	
	}
}
 // end of search result list?>

</div>
<!--div id="content_footborder" style="width:930px; position:absolute; left:0; background:#ccccff; text-align:center">
  &copy; Kementerian Pelajaran Malaysia, 2010.
 </div-->
</div>
<!-- close content_bgwhite -->
</div>
<!-- close content_bgblue -->
</div>
<!-- close content -->

</div>
<!-- close container_content -->

</div>
<!-- close container -->
</body>

<!-- popup menu initial layer----->
<div id="popmenu" class="menu"></div>
<!-- EOpopup menu initial layer----->
